home *** CD-ROM | disk | FTP | other *** search
/ Delphi Magazine Collection 2001 / Delphi Magazine Collection 20001 (2001).iso / DISKS / Issue32 / clinic / EXEU.PAS < prev    next >
Encoding:
Pascal/Delphi Source File  |  1998-01-05  |  753 b   |  42 lines

  1. unit ExeU;
  2.  
  3. interface
  4.  
  5. uses
  6.   SysUtils, WinTypes, WinProcs, Messages, Classes, Graphics, Controls,
  7.   Forms, Dialogs, StdCtrls, Spin;
  8.  
  9. type
  10.   TForm1 = class(TForm)
  11.     Label1: TLabel;
  12.     S1: TSpinEdit;
  13.     S2: TSpinEdit;
  14.     procedure ValueChange(Sender: TObject);
  15.   private
  16.     { Private declarations }
  17.   public
  18.     { Public declarations }
  19.   end;
  20.  
  21. var
  22.   Form1: TForm1;
  23.  
  24. implementation
  25.  
  26. uses
  27.   ImportU;
  28.  
  29. {$R *.DFM}
  30.  
  31. procedure TForm1.ValueChange(Sender: TObject);
  32. begin
  33.   if (S1.Text = '') or (S2.Text = '') then
  34.     Label1.Caption := 'N/A'
  35.   else if S1.Value < 0 then
  36.     Label1.Caption := 'Powers of negative numbers not supported'
  37.   else
  38.     Label1.Caption := FloatToStr(Power(S1.Value, S2.Value));
  39. end;
  40.  
  41. end.
  42.